package com.tql.view.service.impl;

import com.github.pagehelper.PageHelper;
import com.tql.view.mapper.NoticeMapper;
import com.tql.view.pojo.Notice;
import com.tql.view.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    private NoticeMapper noticeMapper;
    @Override
    public Notice getLastOne() {
        return noticeMapper.getLastOne();
    }

    @Override
    public List<Notice> getAllNotice(Integer page, Integer size) {
        PageHelper.startPage(page,size);
        return noticeMapper.getAllNotice(page,size);
    }

    @Override
    public void insertNotice(Map<String, Object> params) {
        noticeMapper.insertNotice(params);
    }


    @Override
    public void deleteNotice(String id) {
        noticeMapper.deleteNotice(id);
    }
}
